<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<?php if($sf_user->hasFlash('error')):?>
    <?php include_partial('global/msg', array('class'=>'error', 'msg'=>$sf_user->getFlash('error'))); ?>
<?php endif;?>
<?php if($sf_user->hasFlash('success')):?>
    <?php include_partial('global/msg', array('class'=>'success', 'msg'=>$sf_user->getFlash('success'))); ?>
<?php endif;?>

<div class="form">
<form action="<?php echo url_for($route) ?>" enctype="multipart/form-data" method="POST">

	<div><?php echo $form->renderGlobalErrors() ?></div>

	<table>
	<tr>
		<td class="label">
	    	<label class="required"><?php echo $form['name']->renderLabel() ?></label>
	    </td>
	    <td>
	        <?php echo $form['name'] ?>
	        <?php echo $form['name']->renderError() ?>
		</td>
	</tr>
	<tr>
		<td class="label">
	    	<label class="required"><?php echo $form['description']->renderLabel() ?></label>
	    </td>
	    <td>
	        <?php echo $form['description'] ?>
	        <?php echo $form['description']->renderError() ?>
		</td>
	</tr>
	<tr>
		<td class="label">
	    	<label><?php echo $form['price']->renderLabel() ?></label>
	    </td>
	    <td>
	        <?php echo $form['price'] ?>
	        <?php echo $form['price']->renderError() ?>
		</td>
	</tr>
	<tr>
		<td class="label">
	    	<label><?php echo $form['new_tags']->renderLabel() ?></label>
	    </td>
	    <td>
	    	<?php include_partial('site/tagForm', array('form' => $form)) ?>
	        <?php echo $form['new_tags']->renderError() ?>
		</td>
	</tr>
	<tr>
		<td class="label">
	    	<label>Imagenes</label>
	    </td>
	    <td>
	    <?php for ($i=0; $i<sfConfig::get('sf_attachments'); $i++): ?>
			<?php echo $form['files'][$i]['description'] ?>
	        <?php echo $form['files'][$i]['description']->renderError() ?>
	    	<?php echo $form['files'][$i]['file'] ?>
	        <?php echo $form['files'][$i]['file']->renderError() ?><br>
		<?php endfor; ?>
		</td>
	</tr>

	</table>
	<?php echo $form->renderHiddenFields() ?>
	<br><br>
	<input type="submit" class="button" value="Guardar" />&nbsp;&nbsp;
	<input type="button" value="Cancelar" onclick="history.back()">
</form>
</div>

